import Vue from 'vue'
import VueRouter from 'vue-router'
import demo1 from '../views/dorm/dorm01.vue'
import allShow from "../views/dorm/allShow";
import chainPage from "../views/dorm/chainPage";
import policesing from "../views/dorm/policesing";
import policesingto from "../views/dorm/policesingto";
import dataTable from "../views/dorm/dataTable";
import deviceManager from "../views/dorm/deviceManager";
import upKeep from "../views/dorm/upKeep";
import energyPage from "../views/dorm/energyPage";
import chainPage1 from "../views/dorm/chainPage/chainPage1";
import chainPage2 from "../views/dorm/chainPage/chainPage2";
import chainPage3 from "../views/dorm/chainPage/chainPage3";
import chainPage4 from "../views/dorm/chainPage/chainPage4";
Vue.use(VueRouter)

/*
const routes = [
  {
    path: '/demo1',
    redirect: '/demo1'
  }
]
*/

const router = new VueRouter({
  routes: [
    {
      path: '/',
      redirect: '/demo1'
    },
    {
      path: '/demo1',
      name: 'demo1',
      component: demo1,
      children:[
        {
          path: '/allShow',
          name: 'allShow',
          component: allShow
        },
        {
          path: '/chainPage',
          name: 'chainPage',
          component: chainPage,
          children:[
            {
              path: '/chainPage1',
              name: 'chainPage1',
              component: chainPage1,
            },
            {
              path: '/chainPage2',
              name: 'chainPage2',
              component: chainPage2,
            },
            {
              path: '/chainPage3',
              name: 'chainPage3',
              component: chainPage3,
            },
            {
              path: '/chainPage4',
              name: 'chainPage4',
              component: chainPage4,
            }
          ]
        },
        {
          path: '/policesing',
          name: 'policesing',
          component: policesing
        },
        {
          path: '/dataTable',
          name: 'dataTable',
          component: dataTable
        },
        {
          path: '/deviceManager',
          name: 'deviceManager',
          component: deviceManager
        },
        {
          path: '/policesingto',
          name: 'policesingto',
          component: policesingto
        },
        {
          path: '/upKeep',
          name: 'upKeep',
          component: upKeep
        },
        {
          path: '/energyPage',
          name: 'energyPage',
          component: energyPage
        }
      ]
    },

  ]
})

export default router
